<?php

	define('IN_ECS', true);
	
	require_once 'dragon/util/common.php';
	require_once 'dragon/util/smarty_utils.php';
	require_once 'dragon/vegetables/service/veget_category_service.php';
	require_once 'dragon/vegetables/service/vegetables_service.php';

	$action = isset($_REQUEST['act']) ? trim($_REQUEST['act']) : 'index';
	
	$categoryService = new VegetCategoryService();
	$vegetablesService = new VegetablesService();
	
	if($action == 'index'){
		$cateList = $categoryService->getIndexCategoryList();
		$vegetResult = $vegetablesService->getVegetablesListByCateId(-1);
		
		$smarty->assign('cate_list', $cateList);
		$smarty->assign('veget_result', $vegetResult);
		
		$smarty->display('vegetables/index.html');
	}
	
	
?>